<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>阻止元素被浮动元素覆盖</title>
    <style>
        .cube1{
            width: 100px;
            height: 100px;
            float: left;
            background-color: red;
        }
        .cube2{
            width: 200px;
            height: 200px;
            background-color: blue;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <div class="cube1"></div>
    <div class="cube2"></div>
</body>
</html>